import { computed } from 'vue';
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';

export const columns = (t: (key: string) => string) => {
  return computed<TableColumnData[]>(() => [
    {
      title: t('searchTable.columns.title'),
      dataIndex: 'title',
      slotName: 'title',
    },
    {
      title: t('searchTable.columns.icon'),
      dataIndex: 'icon',
      slotName: 'icon',
      align: 'center',
    },
    {
      title: t('searchTable.columns.permission'),
      dataIndex: 'permission',
      slotName: 'permission',
    },
    {
      title: t('searchTable.columns.component'),
      dataIndex: 'component',
      slotName: 'component',
    },
    {
      title: t('searchTable.columns.weight'),
      dataIndex: 'weight',
      slotName: 'weight',
      align: 'center',
    },
    {
      title: t('searchTable.columns.defaultState'),
      dataIndex: 'defaultState',
      slotName: 'defaultState',
      align: 'center',
    },
    {
      title: t('searchTable.columns.state'),
      dataIndex: 'state',
      slotName: 'state',
      align: 'center',
    },
    {
      title: t('searchTable.columns.operations'),
      dataIndex: 'operations',
      slotName: 'operations',
      align: 'center',
      fixed: 'right',
      width: 100,
    },
  ]);
};
